Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disabling proxy_http_version directive #531

Merged
merged 2 commits into from
Dec 18, 2014

Conversation

ckaenzig
Copy link
Contributor

The EPEL 6 repository still has version 1.0.15 which does not support
this directive proxy_http_version. Yes, this version is old, but a lot
of people prefer not to use a bleeding edge version from nginx.org.

The EPEL 6 repository still has version 1.0.15 which does not support
this directive proxy_http_version. Yes, this version is old, but a lot
of people prefer not to use a bleeding edge version from nginx.org.
@ckaenzig ckaenzig force-pushed the optional-proxy-http-version branch from 224a550 to 7432862 Compare December 16, 2014 16:32
@@ -106,7 +106,9 @@
}
validate_string($multi_accept)
validate_array($proxy_set_header)
validate_string($proxy_http_version)
if ($proxy_http_version != false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make this if ($proxy_http_version != undef)?

At the moment most other parameters that cause directives to be removed from the config files check for an undef value.

@3flex
Copy link
Contributor

3flex commented Dec 16, 2014

Looks good, just added that one comment about undef vs false so if you could switch that let's get this merged.

Thanks for the contribution!

@ckaenzig
Copy link
Contributor Author

Your suggestion makes sense, but I couldn't make it work as is. The problem is that nginx::config::proxy_http_version is supposed to be set by hiera, but it looks like hiera is not able to return an undef value. If I set "nginx::config::proxy_http_version: undef" in hiera, it seems I get a String object in puppet (tested with @proxy_http_version.class.name in the ERB template). I'm using puppet-server 3.7.3, hiera 1.3.4.

It seems the only way to achieve what I want using undef would be to set the default value of $proxy_http_version to undef. This would remove the proxy_http_version directive in proxy.conf when the class parameter is not set, but the nginx behavior should be unchanged as the defaulf value for this nginx directive is "1.0".

Would it be ok to change the default value of $proxy_http_version in the nginx::config class? I'll update this PR shortly with my proposed change.

The default value in nginx::config was the same as nginx's default,
so it's not necessary to be set in any version of nginx unless one
needs a specific value. This also allows us to use undef when we don't
want the directive to be set instead of false.

Also added a test for the default case.
@3flex
Copy link
Contributor

3flex commented Dec 18, 2014

That's actually how I'd prefer all the parameters work in this module (default undef so the nginx default is used), so that's perfectly OK with me! And thanks for the test! I actually didn't know Ruby nil is the same as Puppet :undef so armed with that knowledge I'll be able to add some additional tests.

3flex added a commit that referenced this pull request Dec 18, 2014
Allow disabling proxy_http_version directive
@3flex 3flex merged commit be30b57 into voxpupuli:master Dec 18, 2014
@ckaenzig
Copy link
Contributor Author

Awesome, thanks for merging!

@ckaenzig ckaenzig deleted the optional-proxy-http-version branch December 18, 2014 15:34
cegeka-jenkins pushed a commit to cegeka/puppet-nginx that referenced this pull request Oct 23, 2017
…rsion

Allow disabling proxy_http_version directive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants